package net.bingosoft.common.struts.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import net.bingosoft.common.struts.BaseAction;
import net.bingosoft.common.util.ExcelUtils;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

/**
 * 2007-8-23 下午02:44:13
 * Author:yangdongyu(yangdy@bingosoft.net)
 * ReadMe:公用的导出Excel的action
 * ChangeLog:
 */
public class ExportExcelAction extends BaseAction{

	@Override
	protected ActionForward doExecute(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) throws Exception {
		ExportActionForm form =(ExportActionForm) actionForm;
		log.debug("导出Excel : " + form.getExportFileName());
		ExcelUtils.exportExcel(form.getExportFileName(), form.getTableHTML(), response);	
		return null;
	}

}
